﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TeacherMainPage.aspx.cs" Inherits="CMSWCSFSolution.CMS.Views.TeacherMainPage"
    Title="TeacherMaster" MasterPageFile="~/Shared/DefaultMaster.master" %>

<asp:Content ID="content" ContentPlaceHolderID="DefaultContent" Runat="Server">
    <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.blockUI.js" type="text/javascript"></script>
    <link href="../Styles/jquery-ui-1.8.24.custom.css" rel="stylesheet" type="text/css" />
    <%--<script src="../Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>--%>

<script src="../Scripts/jquery-ui-1.8.24.custom.min.js" type="text/javascript"></script>

<script src="../Scripts/CMS_dialog.js" type="text/javascript"></script>
		<h1>TeacherMaster</h1>
           <script type="text/javascript">
               {
                   var teacherId;

                   function showDeleteConfirmation(tId) {

                       teacherId = tId
                       $.blockUI({ message: $('#divConfirmBox') });

                   }

                   function deleteTeacher() {
                       $("#<%=hfTeacherId.ClientID%>").val(teacherId);
                       $.unblockUI();
                   }
               }
               </script>

        <script type="text/javascript">

            function GotoCreatePage() {
                window.location.href = "CreateTeacher.aspx";
                return false;
            }
    </script>
    <style type="text/css">
        .style1
        {
            
            margin-top: 0px;
        }
    </style>
        <style type="text/css">
        .style2
        {
         margin-left:60px;
        }
    </style>
    <div class="style1">
        <fieldset class="bold" id="CreateTeacher">
            <legend>Teacher List</legend>
            <br />
                <input type="button" value="Create New Teacher" onclick="GotoCreatePage();" />
                <br />
                <br />
               <asp:GridView ID="GridView1" runat="server" CellPadding="4" 
                ForeColor="#333333" GridLines="None"  OnRowEditing="GridView1_RowEditing"
                    AutoGenerateColumns="False"  Font-Bold="False" DataKeyNames="TeacherId">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:BoundField DataField="TeacherId" HeaderText="Teacher Id" />
                        <asp:BoundField DataField="TeacherName" HeaderText="Teacher Name" />
                        <asp:BoundField DataField="TeacherGender" HeaderText="Teacher Gender" />
                        <asp:TemplateField HeaderText="Department">
                            <%--嵌套绑定--%>
                            <ItemTemplate>
                                <asp:Label ID="labDepartmentName" Text='<%# DataBinder.Eval(Container.DataItem,"DepartMent.DepartmentName") %>'
                                    runat="server"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                              <asp:button id="btnupdate" runat="server"
                                commandname="edit" text="Update" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                        <ItemTemplate>
                               <input type="button" value="Delete" id="btnDelete" onclick="showDeleteConfirmation('<%# Eval("TeacherId") %>')" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#AED0EA" Font-Bold="True" ForeColor="#2779AA " />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
             
             <div id="divConfirmBox"  style="display:none" class=" ui-widget ui-widget-content ui-corner-all ui-jqdialog jqmID1" id="alertmod" dir="ltr" style="width: 200px; height: auto; z-index: 950; overflow: hidden; top: 268px; left: 473px; display: block; " tabindex="-1" role="dialog" aria-labelledby="alerthd" aria-hidden="false">
             <div class="ui-jqdialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" id="alerthd" style="cursor: move; ">
             <span class="ui-jqdialog-title" style="float: left; ">Warning</span>
             <a href="javascript:void(0)" class="ui-jqdialog-titlebar-close ui-corner-all"></a>
             </div>        
              Are you sure you want <br />
              to delete this record?   <br />
             <asp:Button ID="btnDeleteTeacher" OnClientClick="deleteTeacher();" OnClick="btn_DeleteTeacher" UseSubmitBehavior="false" runat="server" Text="Yes" />
             <input type="button" value="No" onclick="$.unblockUI()" />
             <span tabindex="0"><span tabindex="-1" id="jqg_alrt"></span>
             </span>
             <br />
             </div>
             <asp:HiddenField ID="hfTeacherId" runat="server" />
            <asp:LinkButton id="btnFirst"  Text="&lt;&lt;" runat="server" OnClick="PageNavaigage_Click" CommandName="First" ></asp:LinkButton>
            <asp:LinkButton id="btnPre" Text="&lt;" runat="server" OnClick="PageNavaigage_Click" CommandName="Previous" ></asp:LinkButton>
            <asp:Label runat="server" ID="lblPagesIndex" BackColor="White"  ForeColor="Black"></asp:Label>
            <asp:LinkButton id="btnNext" Text=" &gt" runat="server"  OnClick="PageNavaigage_Click" CommandName="Next"></asp:LinkButton>
            <asp:LinkButton id="btnLast" Text=" &gt;&gt;" runat="server" OnClick="PageNavaigage_Click" CommandName="Last" ></asp:LinkButton>
            <asp:Label runat="server" id="lblRowsCount" BackColor="White" ForeColor="Black"></asp:Label> &nbsp;&nbsp;
            <asp:Label runat="server" ID="Label2" Text="Go To：" BackColor="White" ForeColor="Black"></asp:Label>
            <asp:TextBox ID="txtSkipPage" runat="server"  Width="40px" MaxLength="4"></asp:TextBox>
            <asp:Button ID="btnSkip" Text="Go" runat="server"  OnClick="btnSkip_Click"></asp:Button>
            <br />
            <br />
        </fieldset>
    </div>
</asp:Content>